package com.centaur0.springmvc.diario.tema;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.validation.BindException;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.SimpleFormController;

@SuppressWarnings("deprecation")
public class ControllerImpl extends SimpleFormController {
	
	public ControllerImpl(){
		this.setCommandClass(TemaPOJO.class);
		this.setCommandName("tema");
		this.setFormView("diario-gerenciarTema");
	}
	
	public ModelAndView cadastrarTema(HttpServletRequest request, HttpServletResponse response) throws Exception {
		//set
		return new ModelAndView("/diario/gerenciarTema.jsp");
	}
	
	protected ModelAndView onSubmit(HttpServletRequest request,
			HttpServletResponse response, Object command,
			BindException errors) throws Exception {
		return new ModelAndView("/diario/gerenciarTema.jsp");
	}
}
